450A Jzzhu and Children codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,m,i,c=0,ans;
cin>>n>>m;
double maxe=0,a,r;
a=(double)m;
for(i=0;i<n;i++)
{
cin>>a;
r=ceil(a/m);
if(r>=maxe)
{
maxe=r;
ans=i+1;
}
}
cout<<ans<<endl;
return 0;
}
0 Comments